//
//  PointClassTableViewCell3.m
//  fitnessmanage
//
//  Created by wujian on 2018/1/22.
//  Copyright © 2018年 zongquankeji. All rights reserved.
//

#import "PointClassTableViewCell3.h"

@implementation PointClassTableViewCell3

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
    
        /**
         标题图片
         */
        UIImageView *titleImageView = [[UIImageView alloc] init];
        titleImageView.contentMode = UIViewContentModeScaleAspectFit;
        [self.contentView addSubview:titleImageView];
        self.titleImageView = titleImageView;
        
        /**
         标题
         */
        UILabel *titleLabel = [[UILabel alloc] init];
        titleLabel.text = @"标题";
        titleLabel.font = BoldMidBigFont;
        [self.contentView addSubview:titleLabel];
        self.titleLabel = titleLabel;
        
        /**
         详情
         */
        UILabel *detailLabel = [[UILabel alloc] init];
        detailLabel.font = MidFont;
        detailLabel.textColor = CSColorFromRGB(0xb3b3b3);
        [self.contentView addSubview:detailLabel];
        self.detailLabel = detailLabel;
        
        UIView *lineView= [[UIView alloc] init];
        lineView.backgroundColor = CSColorFromRGB(0xe6e6e6);
        [self.contentView addSubview:lineView];
        self.lineView = lineView;;
        
        [self setConstraints];
    }
    
    return self;
}

-(void)setConstraints{
    
    /**
     标题图片
     */
    [self.titleImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.centerY.mas_equalTo(self.contentView);
        
        make.left.mas_equalTo(self.contentView).offset(17);
        
        make.width.height.mas_equalTo(15);
    }];
    
    /**
     标题
     */
    [self.titleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self.contentView).offset(15);
        
        make.left.mas_equalTo(self.titleImageView.mas_right).offset(15);
    }];
    
    /**
     详情
     */
    [self.detailLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(self.titleLabel);
        
        make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(5);
        
    }];
    
    [self.lineView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(self.titleImageView);
        
        make.top.mas_equalTo(self.detailLabel.mas_bottom).offset(15);
        
        make.bottom.right.mas_equalTo(self.contentView);
        
        make.height.mas_equalTo(1);
    }];
}


@end
